﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KTXD.Data;
using KTXD.Entities;

namespace UserKTXD.Controls
{
    public partial class Control_VideoRight : System.Web.UI.UserControl
    {
       
        protected void Page_Load(object sender, EventArgs e)
        {
            
            if (!IsPostBack)
                loadData();
        }

        private void loadData()
        {
            int TotalRows = 0;
            string WhereClause = "1=1 AND TrangThai=1";

            TList<Video> TList_NdungHome = DataRepository.VideoProvider.GetPaged(WhereClause, "NgayCapNhat DESC", 0, 1, out TotalRows);
            drpVideoHome.DataSource = TList_NdungHome;
            drpVideoHome.DataBind();   

            TList<Video> TList_Ndung = DataRepository.VideoProvider.GetPaged(WhereClause, "NgayCapNhat DESC", 1, 4, out TotalRows);
            drpVideo.DataSource = TList_Ndung;
            drpVideo.DataBind();           
        }
        
    }
}
